package main

import (
	"fmt"
	"sync"
	"time"
)

type ActionListT struct {
	sync.RWMutex
	Mp map[int]int
}

func main() {
	var ActionList = ActionListT{Mp: map[int]int{}}

	go func() {
		time.Sleep(time.Second * 4)
		for _, i := range ActionList.Mp {
			fmt.Println("output", i)
			ActionList.Mp[500] = 1
		}
		fmt.Println("end*******************")
	}()

	ActionList.Lock()
	for i := 1; i < 1000; i++ {
		time.Sleep(time.Second * 1)
		fmt.Println("insert", i)
		ActionList.Mp[i] = i
	}
	ActionList.Unlock()

	//creatorMap := map[string]struct{}{
	//	"13333333334": struct{}{},
	//	"13116706881": struct{}{},
	//	"13116706888": struct{}{},
	//	"13133333333": struct{}{},
	//	"15606137681": struct{}{},
	//	"18067985786": struct{}{},
	//	"13017527327": struct{}{},
	//	"19157786395": struct{}{},
	//	"15779421123": struct{}{},
	//	"17300952846": struct{}{},
	//	"13372579793": struct{}{},
	//}
	//
	//if _, ok := creatorMap["sadsad"]; ok {
	//	fmt.Println(ok)
	//}
}
